package net.huashitong.ssydt.money.entity.vo;

import io.swagger.annotations.ApiModelProperty;
import net.huashitong.ssydt.money.constant.MoneyConsts;
import net.huashitong.ssydt.money.entity.SsMoneyGoldBag;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @author <a href="mailto:yhy23456@163.com">huiyang.yu</a>
 * @since 2017.08.14
 */
public class GoldyVo implements Serializable {

    private static final long serialVersionUID = 2175210851384298627L;

    @ApiModelProperty(value = "套餐包Id")
    private Long id;//套餐包Id

    @ApiModelProperty(value = "原价", dataType = "BigDecimal")
    private BigDecimal originalPrice;//原价

    @ApiModelProperty(value = "价格", dataType = "BigDecimal")
    private BigDecimal price;//价格

    @ApiModelProperty(value = "名称")
    private String bagName;//名称

    @ApiModelProperty(value = "描述")
    private String description;//描述

    @ApiModelProperty(value = "金币数量")
    private Long goldNumber; //金币数量
    @ApiModelProperty(value = "苹果商品id")
    private String appleGoodsId;//苹果商品id

    @ApiModelProperty(value = "app类型")
    private String appType;//app类型


    public GoldyVo(SsMoneyGoldBag ssMoneyGoldBag) {
        this.setId(ssMoneyGoldBag.getId());
        this.setOriginalPrice(ssMoneyGoldBag.getOriginalPrice());
        this.setBagName(ssMoneyGoldBag.getBagName());
        this.setDescription(ssMoneyGoldBag.getDescription());
        this.setGoldNumber(ssMoneyGoldBag.getGoldNumber());
        this.appleGoodsId = ssMoneyGoldBag.getAppleGoodsId();
        this.appType = ssMoneyGoldBag.getAppType();
        switch (ssMoneyGoldBag.getNowExecute()) {
            case MoneyConsts.NowExecute.ORIGINA_PRICE:
                this.setPrice(ssMoneyGoldBag.getOriginalPrice());
                break;
            case MoneyConsts.NowExecute.FAVOURABLE_PRICE:
                this.setPrice(ssMoneyGoldBag.getFavourablePrice());
                break;
            case MoneyConsts.NowExecute.PREFERENCE_PRICE:
                this.setPrice(ssMoneyGoldBag.getPreferencePrice());
                break;
            default:
                this.setPrice(ssMoneyGoldBag.getOriginalPrice());
        }

    }

    public GoldyVo() {
    }


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public BigDecimal getOriginalPrice() {
        return originalPrice;
    }

    public void setOriginalPrice(BigDecimal originalPrice) {
        this.originalPrice = originalPrice;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getBagName() {
        return bagName;
    }

    public void setBagName(String bagName) {
        this.bagName = bagName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Long getGoldNumber() {
        return goldNumber;
    }

    public void setGoldNumber(Long goldNumber) {
        this.goldNumber = goldNumber;
    }

    public String getAppleGoodsId() {
        return appleGoodsId;
    }

    public void setAppleGoodsId(String appleGoodsId) {
        this.appleGoodsId = appleGoodsId;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("GoldyVo{");
        sb.append("id=").append(id);
        sb.append(", originalPrice=").append(originalPrice);
        sb.append(", price=").append(price);
        sb.append(", bagName='").append(bagName).append('\'');
        sb.append(", description='").append(description).append('\'');
        sb.append(", goldNumber=").append(goldNumber);
        sb.append('}');
        return sb.toString();
    }
}
